package com.nutransit.dialogs;

import com.nutransit.R;
import com.nutransit.Registration_Activity;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.sax.StartElementListener;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageView;

public class Dialog_signup_with {
	
	private Context context;
	private Activity activity;
	public Dialog main_dialog;
	
	private ImageView imageViewCloseDialog_sign_up;
	private Button button_signup_van,button_signup_cab,button_signup_user;
	
	public Dialog_signup_with(Context context,Activity activity){
		
		this.activity = activity;
		this.context = context;
		
		main_dialog = new Dialog(context);
		main_dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
		main_dialog.setContentView(R.layout.dialog_signup_with);
		main_dialog.show();
		main_dialog.setCancelable(false);
		
		init_vars();
	}

	private void init_vars() {
		// Image View 
		imageViewCloseDialog_sign_up = (ImageView) main_dialog.findViewById(R.id.imageViewCloseDialog_sign_up);
		
		//  Buttons view
		button_signup_van = (Button) main_dialog.findViewById(R.id.button_signup_van);
		button_signup_cab = (Button) main_dialog.findViewById(R.id.button_signup_cab);
		button_signup_user = (Button) main_dialog.findViewById(R.id.button_signup_user);
		
		imageViewCloseDialog_sign_up.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				main_dialog.dismiss();
			}
		});
		
		button_signup_van.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				Intent i = new Intent(context,Registration_Activity.class);
				i.putExtra("type", "van");
				context.startActivity(i);
				main_dialog.dismiss();
				
			}
		});
		
		button_signup_cab.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				Intent i = new Intent(context,Registration_Activity.class);
				i.putExtra("type", "cab");
				context.startActivity(i);
				main_dialog.dismiss();
			}
		});
		
		button_signup_user.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				Intent i = new Intent(context,Registration_Activity.class);
				i.putExtra("type", "user");
				context.startActivity(i);
				main_dialog.dismiss();
			}
		});
		
		
		
	}

}
